#!/bin/sh
# 启动zookeeper
cd ~/Desktop/github/kafka/bin
sh zookeeper-server-start.sh -daemon ../config/zookeeper.properties

# 启动kafka
sh kafka-server-start.sh -daemon ../config/server.properties

# 启动redis(本机环境开机自动启动redis) 远程服务器需重新配置

# 编译im_backend
cd $GOPATH/src/im_backend
make build

# 编译discovery
# 修改Makefile的discovery-example.toml --> discovery.toml
cd $GOPATH/src/github.com/discovery
make build

# 启动discovery
./dist/bin/discovery -conf ./dist/conf/discovery.toml &

# 设置环境变量
export REGION=sh
export ZONE=sh001
export DEPLOY_ENV=dev

# 启动comet & logic & job
cd $GOPATH/src/im_backend
make run
